<?xml version="1.0" encoding="UTF-8"?>
<!--
  Created by IntelliJ IDEA.
  User: imon
  Date: 2/18/13
  Time: 9:06 PM
-->

<ui:composition template="templates/layout.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:c="http://java.sun.com/jsp/jstl/core">


    <ui:define name="#{var['layout.title']}">
        <title>#{msg['myIssues.title']}</title>
    </ui:define>

    <ui:define name="#{var['layout.content']}">
        <ui:include src="templates/user_menu.xhtml"/>

        <div style="padding-top: 5px; font-size: 17px">

            <c:choose>
                <c:when test="#{not empty myIssuesController.user.issueList}">

                    <p:dataList value="#{myIssuesController.user.issueList}" var="userIssueList"
                                paginator="true" rows="4" effectSpeed="fast"
                                paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}"
                                rowsPerPageTemplate="4,10,15" type="none">

                        <f:facet name="header">
                            My Issues
                        </f:facet>
                        <br/>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="#{msg['myIssues.outputLabel.title']} "/>
                            <h:outputText value="#{userIssueList.title}"/>
                            <h:outputLabel value="#{msg['myIssues.outputLabel.helpFor']} "/>
                            <h:outputText value="#{userIssueList.helpFor}"/>
                            <h:outputLabel value="#{msg['myIssues.outputLabel.description']} "/>
                            <h:outputText escape="false" value="#{userIssueList.description}"/>
                            <h:outputLabel value="#{msg['myIssues.outputLabel.creationDate']} "/>
                            <h:outputText value="#{userIssueList.createdDate}"/>

                        </h:panelGrid>

                        <br/>
                        <p:separator/>
                    </p:dataList>
                </c:when>

                <c:otherwise>
                    <p:panel>
                        <f:facet name="header">
                            #{msg['myIssues.facet']}
                        </f:facet>
                        <p:outputLabel>
                            #{msg['myIssues.noIssue']}
                        </p:outputLabel>
                    </p:panel>
                </c:otherwise>
            </c:choose>
        </div>
    </ui:define>

</ui:composition>